package away3d.animators.skeleton ;
/**
 * Author: David Lenaerts
 */

import flash.geom.Vector3D ;
import away3d.animators.data.SkeletonAnimationSequence ;


/**
 * SkeletonClipNodeBase provides an abstract base class for animation blend tree nodes containing a clip.
 */
class SkeletonClipNodeBase extends SkeletonTreeNode
{


    /**
    * The animation clip.
    */
    private var _clip           : SkeletonAnimationSequence ;
    private var _rootPos        : Vector3D<Float> ;
    private var _highQuality    : Boolean ;
    
    
    
    /**
     * Creates a new SkeletonPhaseClipNode object.
     * @param numJoints The amount of joints in the target skeleton.
     */ 
    public function new()
    {
        
        super() ;
        _rootPos = new Vector3D() ;
        
    }
    
    
    public function highQuality( get_highQuality, set_highQuality ) : Bool ;
    
    
    /**
     * Defines whether to use spherical (true) or regular (false) linear interpolation for the joint orientations.
     */ 
    private function get_highQuality() : Bool
    {
        
        return _highQuality;
        
    }
    
    
    public function set highQuality( value : Bool ) : Bool
    {
        
        _highQuality = value ;
        return value ;
        
    }
    
    
    public var duration( get_duration, set_duration ) : Float ;
    
    
    /**
     * @inheritDoc
     */
    override private function get_duration() : Float
    {
        
        return _clip.duration;
        
    }
    
    
    public function clip( get_clip, set_clip ) : SkeletonAnimationSequence ;
    
    
    private function get_clip() : SkeletonAnimationSequence
    {
        
        return _clip ;
        
    }
    
    
    private function set_clip( value : SkeletonAnimationSequence ) : SkeletonAnimationSequence
    {
        
        _clip       = value ;
        _rootPos.x  = 0 ;
        _rootPos.y  = 0 ;
        _rootPos.z  = 0 ;
        
        return value ;
        
    }
    
    
}
